package com.sec.android.app.myfiles.info;

import android.graphics.Typeface;
import android.os.Environment;

import java.util.concurrent.TimeUnit;

public class AppConstants {
    public static final int UNDEFINED = -1;

    public static final String MY_FILES_PACKAGE_NAME = "com.sec.android.app.myfiles";
    public static final String CLOUD_GATEWAY_PACKAGE_NAME = "com.samsung.android.slinkcloud";
    public static final String MY_FILES_ACTIVITY_NAME = "com.sec.android.app.myfiles.common.MainActivity";
    public static final String MY_FILES_NAME_SPACE = "http://schemas.android.com/apk/res-auto";
    public static final String EXT_SD_CARD_ROOT = "/storage/extSdCard";

    public static final String[] MEDIASCAN_SKIP_DIRECTORY = new String[]{".face", ".thumbnails", "Android/data", ".cloudagent"};

    /**
     * This is extra of Intent to other module.
     */
    public static final String INTENT_FROM_MYFILES = "from-myfiles";
    public static final String INTENT_KEY_FILENAME = "key_filename";
    public static final String INTENT_FROM_HOME_SHORTCUT = "from_home_shortcut";
    //public static final String SETTINGS_DEVICE_NAME = "device_name";
    public static final String INTENT_KEY_FILE_PATH = "AbsolutePath";
    public static final String INTENT_KEY_PARENT_FOLDER = "PARENT_FOLDER";
    public static final String INTENT_FROM_SAMSUNG_INTERNET = "from_sbrowser";

    public static final int OPEN_FILE = 10;

    // Screen state
    public static final int PORTRAIT = 0;
    public static final int LANDSCAPE = 1;
    //public static final int PORTRAIT_MULTIWINDOW = 2;
    //public static final int LANDSCAPE_MULTIWINDOW = 3;

    // MultiWindow state

    public static final int MAX_SHORTCUTS_COUNT = 10;
    public static final int MAX_TABS_COUNT = 20;

    //public static final String DRAG_DROP_LABEL = "selectedUri";
    public static final int DRAG_DROP_SELECT_LIMIT_COUNT = 100;
    //public static final String SELECT_RESULT_PATH = "FILE";

    // Indeterminate Progress state
    public static final int INDETERMINATE_PROGRESS_START = 159;
    public static final int INDETERMINATE_PROGRESS_END = 357;

    /**
     * Merge Cursor
     */
    public static final int MAX_CURSOR_DATA_COUNT = 5000;

    /**
     * Editor
     */
    public static final int MAX_INPUT_LENGTH = 50;

    /**
     * ThreadPool
     */
    private static final int NUMBER_OF_CORES = Runtime.getRuntime().availableProcessors();
    public static final int NUMBER_OF_THREADS = NUMBER_OF_CORES > 4 ? NUMBER_OF_CORES - 4 : NUMBER_OF_CORES;
    public static final int IDLE_THREAD_KEEP_ALIVE_TIME = 500;
    public static final TimeUnit IDLE_THREAD_KEEP_ALIVE_TIME_UNIT = TimeUnit.MILLISECONDS;

    /**
     * Recent
     */
    public static final int HOME_RECENT_MAX_ITEM_COUNT_EIGHT = 8;
    public static final int HOME_RECENT_MAX_ITEM_COUNT_FOUR = 4;
    //public static final int HOME_RECENT_MAX_ITEM_COUNT_ZERO = 0;

    /**
     * picker
     */
    public static final int SELECT_LIMIT_COUNT = 500;

    /**
     * Action bar
     */
    public static final float SELECTED_COUNT_ITEM_MAX_FONT_SCALE = 1.2F;

    /**
     * TreeView
     */
    public static final int DRAG_AND_DROP_FOLDER_OPEN_DELAY_TIME = 700;

    /**
     * Local broadcast
     */
    public static final String MYFILES_ACTION_DRAG_AND_DROP_START = "com.sec.android.app.myfiles.DRAG_AND_DROP_START";
    public static final String MYFILES_ACTION_DRAG_AND_DROP_END = "com.sec.android.app.myfiles.DRAG_AND_DROP_END";
    public static final String MYFILES_ACTION_DRAG_AND_DROP_FINISH = "com.sec.android.app.myfiles.DRAG_AND_DROP_FINISH";
    public static final String MYFILES_ACTION_VIEW_AS_CHANGED = "com.sec.android.app.myfiles.VIEW_AS_CHANGED";
    public static final String MYFILES_ACTION_SORT_BY_CHANGED = "com.sec.android.app.myfiles.SORT_BY_CHANGED";
    public static final String MYFILES_ACTION_SHOW_HIDDEN_FILES_CHANGED = "com.sec.android.app.myfiles.SHOW_HIDDEN_FILES_CHANGED";
    public static final String MYFILES_ACTION_GMS_LAUNCHED = "com.sec.android.app.myfiles.GET_MORE_SPACE_LAUNCHED";
    public static final String DISMISS_DIALOG = "com.sec.android.app.myfiles.DISMISS_DIALOG";
    public static final String EXTRA_PROCESS_ID = "com.sec.android.app.myfiles.PROCESS_ID";
    public static final String MYFILES_ACTION_FOLDER_DELETED = "com.sec.android.app.myfiles.FOLDER_DELETED";
    public static final String MYFILES_ACTION_DOWNLOAD_HISTORY_INSERTED = "com.sec.android.app.myfiles.DOWNLOAD_HISTORY_INSERTED";
    public static final String PLAY_STORE_PACKAGE_NAME = "com.android.vending";
    public static final String GALAXY_APPS_PACKAGE_NAME = "com.sec.android.app.samsungapps";
    public static final String EXTRA_TAG = "com.sec.android.app.myfiles.TAG";
    public static final String MYFILES_ACTION_SHOW_RECENT_FILES_CHANGED = "com.sec.android.app.myfiles.SHOW_RECENT_FILES_CHANGED";
    public static final String CHECK_SMART_TIP = "com.sec.android.app.myfiles.CHECK_SMART_TIP";


    /**
     * Broadcast sent to MyFiles when the alarm which MyFiles sets goes off.
     */
    public static final String ACTION_CHECK_FREE_SPACE = "com.sec.android.app.myfiles.CHECK_FREE_SPACE";

    /**
     * Broadcast sent to MyFiles when pressing the DENY button in Optimize Storage Notification.
     */
    public static final String ACTION_DELAY_OPTIMIZE = "com.sec.android.app.myfiles.DELAY_OPTIMIZE";

    public interface UiType {
        int PHONE = 0, TABLET = 1;
    }

    /**
     * ACCESSIBILITY
     */
    //public static final int ACCESSIBILITY_HIGH_TEXT_CONTRAST_DISABLED = 0;
    public static final int ACCESSIBILITY_HIGH_TEXT_CONTRAST_ENABLED = 1;
    public static final String HIGH_TEXT_CONTRAST_DISABLED = "high_text_contrast_enabled";

    public interface FontTypeface {
        //"sec-roboto-light" with normal style
        Typeface SEC_ROBOTO_LIGHT = Typeface.create("sec-roboto-light", Typeface.NORMAL);

        //"sec-roboto-regular" with normal style
        //Typeface SEC_ROBOTO_REGULAR = Typeface.create("sec-roboto-regular", Typeface.NORMAL);
    }

    public interface ImeOptions {
        // The IME option to disable prediction.
        String PREDICTION_OFF = "inputType=PredictionOff";

        // The IME option to disable emoticon input.
        String EMOTICON_OFF = "disableEmoticonInput=true";

        // The IME option to disable '*' '/' symbol.
        String SYMBOL_OFF = "inputType=filename";

        // The IME option to disable voice input
        String VOICEINPUT_OFF = "disableVoiceInput=true";

        // The IME option to enable only number input without hyphen or dot in keyboard.
        String NUMBERPAD_ONLY = "inputType=YearDateTime_edittext";
    }

    public interface SortByType {
        int TIME = 0, TYPE = 1, NAME = 2, SIZE = 3;
    }

    public interface SortByOrder {
        int ASC = 0, DESC = 1;
    }

    public interface ViewType {
        int LIST = 0, LIST_DETAIL = 1, GRID = 2, RECENT = 3, FOLDER_TREE = 4, TABLET_GRID_SMALL = 5, TABLET_GRID_LARGE = 6;
    }

    public interface ConvertType {
        int AS_IMAGE_FILES = 0, AS_VIDEO_FILES = 1;
    }

    public interface ActivityType {
        int FILE_LIST_ACTIVITY = 0, PICKER_ACTIVITY = 1;
    }

    public interface StoragePath {
        String ROOT = "/storage";

        // below is usually hided to user.
        String EMULATED_ENTRY_FOLDER = "/storage/emulated";
        String INTERNAL_ROOT = Environment.getExternalStorageDirectory().getAbsolutePath();
        String PRIVATE_ROOT = "/storage/Private";

        String GOOGLE_DRIVE_FOLDER = "/Google Drive";
        String SAMSUNG_DRIVE_FOLDER = "/Samsung Drive";

        String CATEGORY_IMAGE = "/Image";
        String CATEGORY_VIDEO = "/Video";
        String CATEGORY_AUDIO = "/Audio";
        String CATEGORY_DOCUMENT = "/Document";
        String CATEGORY_APK = "/Apk";

        String RECENT_FILES = "/RecentFiles";
        String BLANK = "/Blank";
        String SHORTCUT_FILES = "/ShortcutFiles";
        String DOWNLOADS = "/Downloads";        // for MyFiles - Downloads category
        String DOWNLOAD_HISTORY = "/DownloadHistory";   // Request VIEW_DOWNLOADS from SBrowser - Download History
        String DOWNLOAD_HISTORY_FROM_OTHERS = "/DownloadHistoryFromOthers"; // Request VIEW_DOWNLOADS except for Internet Browser

        String INTERNAL_ROOT_CONVERT = "/device_storage";
        String ROOT_CONVERT = "/external";

        String OPTIMIZE_STORAGE_OVERVIEW = "/OptimizeStorageOverview";
        String OPTIMIZE_STORAGE_LARGE_FILES = "/LargeFiles";
        String OPTIMIZE_STORAGE_UNUSED_FILES = "/UnusedFiles";
        String OPTIMIZE_STORAGE_DUPLICATE_FILES = "/DuplicateFiles";
        String OPTIMIZE_STORAGE_UNNECESSARY_DATA = "/UnnecessaryData";

        String SAMSUNG_DRIVE_TRASH_FILES = "/SamsungDriveTrashFiles";
    }

    public interface CloudType {
        // web_storage_type in DEVICES table
        String GOOGLE_DRIVE = "googledrive";
        String SAMSUNG_DRIVE = "samsungdrive";
    }

    public interface DownloadHistoryType {
        int OK = 100;
        int CANCEL = 101;
        int SUCCESS = 200;
        int FAIL = 300;
    }

    public interface AppUpdateBadge {
        int NO_APP_UPDATE = 0;
        int EXIST_NEW_APP_UPDATE = 1; // with cloud apk
    }

    public interface Action {
        String ACTION_LAUNCH_MY_FILES = "samsung.myfiles.intent.action.LAUNCH_MY_FILES";
        String ACTION_EXECUTABLE_RECENT = "samsung.myfiles.intent.action.EXECUTABLE_RECENT";
        String ACTION_CREATE_DOCUMENT = "com.sec.android.app.myfiles.CREATE_DOCUMENT";
        String ACTION_PICK_SELECT_PATH = "com.sec.android.app.myfiles.PICK_SELECT_PATH";
        String PICK_DOWNLOADS = "com.sec.android.app.myfiles.PICK_DATA_DOWNLOAD";
        String VIEW_CATEGORY = "com.sec.android.app.myfiles.VIEW_CATEGORY";
        String PICK_SINGLE = "com.sec.android.app.myfiles.PICK_DATA";
        String PICK_MULTIPLE = "com.sec.android.app.myfiles.PICK_DATA_MULTIPLE";
        String RUN_OPTIMIZE_STORAGE = "com.sec.android.app.myfiles.RUN_OPTIMIZE_STORAGE";
    }

    public interface MyFilesExtras {
        String EXTRA_START_PATH = "samsung.myfiles.intent.extra.START_PATH";
        String START_FROM_NOTIFICATION = "samsung.myfiles.intent.extra.START_FROM_NOTIFICATION";
        String EXTRA_CATEGORY_TYPE = "SELECTOR_CATEGORY_TYPE";
        String URI = "uri";
        String EXTRA_CONTENT_TYPE = "CONTENT_TYPE";
        String EXTRA_CONTENT_EXTENSION = "CONTENT_EXTENSION";
        String EXTRA_FOLDER_PATH = "FOLDERPATH";
        String EXTRA_START_FOLDER = "START_FOLDER";
        String EXTRA_FILE_SELECTION_MAX_COUNT = "max_file_count";
        String EXTRA_NEED_MEDIA_SCAN = "needScan";
        String EXTRA_PREFIX_FOR_EXTENSION = "PREFIX";  // only for wifi certificates
        String EXTRA_START_BIXBY = "START_BIXBY";

        String EXTRA_START_CLOUD_INFO = "samsung.myfiles.intent.extra.START_CLOUD_INFO";
        String EXTRA_CLOUD_DEVICEID = "deviceID";
        String EXTRA_CLOUD_PARENTID = "parentID";
        String EXTRA_CLOUD_FILEID = "fileID";
        String EXTRA_CLOUD_FILENAME = "fileName";
        String EXTRA_START_CLOUD_FROM = "FROM";
        String EXTRA_START_CLOUD_FROM_SAMSUNG_CLOUD = "com.sec.android.app.myfiles.START_FROM_SAMSUNG_CLOUD";
    }

    public interface AccessoryKeyboardState {
        int KEYBOARD_UNDEFINED = 0x00;
        //int KEYBOARD_EXTERNAL= 0x01;
        //int KEYBOARD_DOCK = 0x01;
        //int KEYBOARD_BT = 0x02;
        //int KEYBOARD_USB = 0x04;
        //int HID_BT = 0x08;
        //int KEYBOARD_PSS = 0x10;
        //int KEYBOARD_KMS = 0x20;
    }

    public interface ObserverType {
        int CURRENT_FOLDER = 0;
        int SUBFOLDER = 1;
    }

    public interface PanelInfo {
        int None = 0;
        int LeftPanel = 1;
        int RightPanel = 2;
    }

    public interface NotificationActionType {
        int REPEAT_ONE_HOUR = 0;
        int DELAY_TWO_WEEKS = 1;
        int NONE = 2;
    }

    public interface SmartTipType {
        int GMS = 0;
        int CLOUD = 1;
        int GMS_CHECK = 2;
        int CLOUD_CHECK = 3;
    }

    public interface BixbyRuleIdRange {
        int NONE             = 0;
        int AROUND_100_TIMES = 1;
        int AROUND_200_TIMES = 2;
        int AROUND_300_TIMES = 3;
        int AROUND_400_TIMES = 4;
        int AROUND_500_TIMES = 5;
        int AROUND_600_TIMES = 6;
        int AROUND_700_TIMES = 7;
        int AROUND_800_TIMES = 8;
        int AROUND_900_TIMES = 9;
        int AROUND_1100_TIMES = 10;
    }

    public interface MarketType {
        int NOT_SUPPORT = 0;
        int PLAY_STORE = 1;
        int GALAXY_APPS = 2;
    }

    public static final int SEF_FILE_TYPE_GEAR_360_IMAGE = 2640;

    public static final long AVAILABLE_DEVICE_STORAGE_FREE_SPACE = 50000000L; //50MB

    public static final String MEDIA_STORE_FILE_COLUMNS_FORMAT = "format"; // MediaStore.Files.FileColumns.FORMAT
    public static final String MEDIA_STORE_FILE_COLUMNS_DATE_ACCESSED = "date_accessed"; // MediaStore.Files.FileColumns.FORMAT

    public static final int SCREEN_WIDTH_DP_800 = 800;
    public static final int SCREEN_WIDTH_DP_600 = 600;

    public static final String MEDIA_PROVIDER_AUTHORITY = "media";
    public static final long LARGE_IMAGE_SIZE = 1024 * 1024 * 15; //15MBytes
}
